export default {
	ENV:{
		RELEASE:"release",
		DEVELOP:"develop",
		TRIAL:"trial"
	},
	MIN_TYPE:{
		WEIXIN:"weixin",
		BAIDU:"baidu",
		TOUTIAO:"toutiao",
		ALIPAY:"alipay",
		QQ:"qq",
		KUAISHOU: 'kuaishou'
	},
	
	MIN_CHANNEL:{
		WEIXIN:1,
		BAIDU:3,
		TOUTIAO:2,
		ALIPAY:4,
		QQ:5,
		KUAISHOU: 6
	},
	
	// 新增参数 channel（number）（渠道 1,微信小程序 2，头条小程序 3，百度小程序）

	
	getEnv(){
		let env=this.ENV.RELEASE;
		// #ifdef MP-BAIDU
		let res = swan.getEnvInfoSync();
		switch (res.env) {
			case 'development':
				env = this.ENV.DEVELOP;
				break;
			case 'trial':
				env = this.ENV.TRIAL;
				break;
			case 'production':
				env = this.ENV.RELEASE
				break;
			default:
		}
		// #endif
		
		// #ifdef MP-TOUTIAO
		switch (tt.env.VERSION) {
			case 'development':
				env = this.ENV.DEVELOP;
				break;
			case 'preview':
				env = this.ENV.TRIAL;
				break;
			case 'production':
				env = this.ENV.RELEASE
				break;
			default:
		}
		// console.log(this.ENV,this.ENV.DEVELOP,tt.env.VERSION,"tt.env.VERSION")
		// // #endif
		
		// #ifdef MP-WEIXIN 
		if(__wxConfig && __wxConfig.envVersion){
			env = __wxConfig.envVersion;
		}
		// #endif
		
		
		return  env; 
		
	}
	,
	getMinType(){
		let type = this.MIN_TYPE.KUAISHOU;
		//#ifdef MP-WEIXIN
		type= this.MIN_TYPE.WEIXIN
		//#endif
		//#ifdef MP-TOUTIAO
		type= this.MIN_TYPE.TOUTIAO
		//#endif
		//#ifdef MP-BAIDU
		type= this.MIN_TYPE.BAIDU
		//#endif
		//#ifdef MP-ALIPAY
		type= this.MIN_TYPE.ALIPAY
		//#endif
		//#ifdef MP-QQ
		type= this.MIN_TYPE.QQ
		//#endif
		return type;
	}
	,
	getMinChannel(){
		let channel = this.MIN_CHANNEL.KUAISHOU;
		//#ifdef MP-WEIXIN
		channel= this.MIN_CHANNEL.WEIXIN;
		//#endif
		//#ifdef MP-TOUTIAO
		channel= this.MIN_CHANNEL.TOUTIAO
		//#endif
		//#ifdef MP-BAIDU
		channel= this.MIN_CHANNEL.BAIDU
		//#endif
		//#ifdef MP-ALIPAY
		channel= this.MIN_CHANNEL.ALIPAY
		//#endif
		//#ifdef MP-QQ
		channel= this.MIN_CHANNEL.QQ
		//#endif
		return channel;
	}
}